﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ProjectSem3.admin
{
    public partial class WebForm11 : System.Web.UI.Page
    {
        private DataClasses1DataContext dc = new DataClasses1DataContext();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void ButtonInsert_Click(object sender, EventArgs e)
        {
            string title = this.TextBoxTitle.Text;
            string content = this.CKEditor1.Text;
            insertnews(title, content);
        }
        public void insertnews(string title, string content)
        {
            Artical atc = new Artical();
            atc.title = title;
            atc.content = content;
            atc.categoryID = 4;
            this.dc.Articals.InsertOnSubmit(atc);
            this.dc.SubmitChanges();
            Response.Redirect("NewsManager.aspx");
        }
    }
}